Skip to content

refactor: shrink SchemaError#16653

Merged
crepererum merged 1 commit into
apache:mainfrom
crepererum:crepererum/shrink-schema-error
Jul 4, 2025
Merged

refactor: shrink SchemaError#16653
crepererum merged 1 commit into
apache:mainfrom
crepererum:crepererum/shrink-schema-error

Conversation

@crepererum

@crepererum crepererum commented Jul 2, 2025

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

What changes are included in this PR?

Box a field.

Are these changes tested?

Unit test.

Are there any user-facing changes?

Breaking: SchemaError::AmbiguousReference::column is now boxed.

@github-actions github-actions Bot added logical-expr Logical plan and expressions common Related to common crate labels Jul 2, 2025
Comment thread datafusion/common/src/error.rs Outdated

#[test]
fn test_error_size() {
assert_eq!(size_of::<SchemaError>(), 40);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3

@Dandandan

Dandandan commented Jul 2, 2025

Copy link
Copy Markdown
Contributor

So you pay for that on the "happy path" as well

Is this also something we could see in benchmarks?

@crepererum

Copy link
Copy Markdown
Contributor Author

So you pay for that on the "happy path" as well

Is this also something we could see in benchmarks?

Potentially, but I guess that DataFusionError would be the actual contributor. Fixing that would require a bit more work though, that's why I started with one of the sub-types first.

@comphead comphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @crepererum for taking care of that, I suspect it is motivated by clippy complains https://rust-lang.github.io/rust-clippy/v0.0.212/#large_enum_variant

Comment thread datafusion/expr/src/logical_plan/builder.rs Outdated
@alamb alamb added the api change Changes the API exposed to users of the crate label Jul 3, 2025
@alamb

alamb commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

I think technically this is an API change so it would nice to leave a note in the upgrade guide. I'll make a PR

@alamb

alamb commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

Comment thread datafusion/common/src/error.rs Outdated

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THanks @crepererum

@crepererum

Copy link
Copy Markdown
Contributor Author

Thanks @crepererum for taking care of that, I suspect it is motivated by clippy complains rust-lang.github.io/rust-clippy/v0.0.212#large_enum_variant

yes, that was the hint that triggered that investigation

@crepererum crepererum force-pushed the crepererum/shrink-schema-error branch from 7937ecf to 32d47d5 Compare July 4, 2025 10:35
@crepererum

Copy link
Copy Markdown
Contributor Author

Rebased after #16672.

@crepererum crepererum force-pushed the crepererum/shrink-schema-error branch from 32d47d5 to be0fdad Compare July 4, 2025 11:08
One step towards apache#16652.

Co-authored-by: Oleks V <comphead@users.noreply.github.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
@crepererum crepererum force-pushed the crepererum/shrink-schema-error branch from be0fdad to ef32eba Compare July 4, 2025 11:35
@crepererum crepererum merged commit a715173 into apache:main Jul 4, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change Changes the API exposed to users of the crate common Related to common crate logical-expr Logical plan and expressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants